using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Gigaframe;

namespace Gigaframe
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            DataSystem ds = new DataSystem("c:\\data");

            //ds.CreateColumn("DATABASENAME", "TABLENAME", "USERID", DataSystem.DataTypes.Text);

            ds.SetData("DATABASENAME", "TABLENAME", "RDEMELO", "FIRSTNAME", "Robert", Gigaframe.DataSystem.DataTypes.Text);
            ds.SetData("DATABASENAME", "TABLENAME", "RDEMELO", "LASTNAME", "DeMelo", Gigaframe.DataSystem.DataTypes.Text);
            ds.SetData("DATABASENAME", "TABLENAME", "RDEMELO", "PHONE", "333-333-3333", Gigaframe.DataSystem.DataTypes.Text);
            ds.SetData("DATABASENAME", "TABLENAME", "RDEMELO", "STREET", "123 Road St", Gigaframe.DataSystem.DataTypes.Text);
            ds.SetData("DATABASENAME", "TABLENAME", "RDEMELO", "CITY", "Toronto", Gigaframe.DataSystem.DataTypes.Text);
            ds.SetData("DATABASENAME", "TABLENAME", "RDEMELO", "PROVINCE", "Ontario", Gigaframe.DataSystem.DataTypes.Text);

            ds.SetData("DATABASENAME", "TABLENAME", "JSMITH", "FIRSTNAME", "John", Gigaframe.DataSystem.DataTypes.Text);
            ds.SetData("DATABASENAME", "TABLENAME", "JSMITH", "LASTNAME", "Smith", Gigaframe.DataSystem.DataTypes.Text);
            ds.SetData("DATABASENAME", "TABLENAME", "JSMITH", "PHONE", "416-555-5555", Gigaframe.DataSystem.DataTypes.Text);
            ds.SetData("DATABASENAME", "TABLENAME", "JSMITH", "STREET", "123 Street Rd", Gigaframe.DataSystem.DataTypes.Text);
            ds.SetData("DATABASENAME", "TABLENAME", "JSMITH", "CITY", "Toronto", Gigaframe.DataSystem.DataTypes.Text);
            ds.SetData("DATABASENAME", "TABLENAME", "JSMITH", "PROVINCE", "Ontario", Gigaframe.DataSystem.DataTypes.Text);

            textBox1.Text = (string)ds.GetData("DATABASENAME", "TABLENAME", "RDEMELO", "PHONE");

            DataTable dt = ds.GetDataTable("DATABASENAME", "TABLENAME", "CITY='Toronto'", "");

            dataGridView1.DataSource = dt;

        }
    }
}